package cn.JHai.service.impl;
import javax.security.auth.login.LoginException;

import cn.JHai.dao.FavoritesDao;
import cn.JHai.dao.UsersDao;
import cn.JHai.domain.User;
import cn.JHai.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
@Service("userServiceImp")
public class UserServiceImp implements UserService{


	@Autowired
	UsersDao usersDao;

	@Override
	public boolean insert(User user) {
		return usersDao.insert(user);
	}

	@Override
	public ArrayList<User> findAll() {
		return usersDao.findAll();
	}

	@Override
	public User find(int uid) {
		return usersDao.find(uid);
	}

	@Override
	public User findUser(String name, String password) {
		return usersDao.findUser(name,password);
	}

	@Override
	public boolean delete(int id) {
		return usersDao.delete(id);
	}

	@Override
	public boolean update(User user) {
		return usersDao.update(user);
	}
}